

package jetbrains.buildServer.server.rest.data.finder.syntax;

import java.util.Arrays;
import java.util.stream.Collectors;
import jetbrains.buildServer.requirements.RequirementType;
import jetbrains.buildServer.server.rest.data.locator.*;
import jetbrains.buildServer.server.rest.data.locator.definition.LocatorDefinition;

public class ValueCondition implements LocatorDefinition {
  public static final Dimension SINGLE_VALUE = CommonLocatorDimensions.SINGLE_VALUE("Value for 'equals' match.");
  public static final Dimension VALUE = Dimension.ofName("value").syntax(PlainValue.string()).build();
  public static final Dimension MATCH_TYPE = Dimension.ofName("matchType")
                                                      .syntax(
                                                        EnumValue.of(Arrays.stream(RequirementType.values()).map(RequirementType::getName).collect(Collectors.toList()))
                                                      ).build();
  public static final Dimension IGNORE_CASE = Dimension.ofName("ignoreCase").syntax(new BooleanValue()).build();
}